﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--<link href="Content/CSS/bootstrap-combined.min.css" rel="stylesheet" />
    <link href="Content/CSS/layoutit.css" rel="stylesheet" />-->
    <link href="../Content/CSS/bootstrap.min.css" rel="stylesheet" />
    <link href="../Content/CSS/font-awesome.min.css" rel="stylesheet" />
    <link href="../Content/CSS/site.min.css" rel="stylesheet" />
    <script src="../Content/JS/jquery.min.js"></script>
    <script src="../Content/JS/bootstrap.min.js"></script>
    <script src="~/Content/Area/distpicker.data.js"></script>
    <script src="~/Content/Area/distpicker.js"></script>
    <title></title>
    <style type="text/css">
        .p-price { color: red; line-height: 20px; text-align: left; font-size: 20px; }
        .p-title { text-align: left; }
        .projects .thumbnail .caption { height: 90px; }
        .projects .thumbnail { margin-bottom: 10px; }
        .btn { border-radius: 0px; }
    </style>
</head>
<body>
    <div class="container projects">
        <input type="hidden" id="address" name="address" value="19_1607_4773_0" />
        <input type="hidden" id="type" name="type" value="京东" />

        <table>
            <tr>
                <td>
                    <div class="input-group">
                        <span class="input-group-addon">关键字：</span>
                        <input id="keyword" name="keyword" class="form-control" type="text" value="抽纸" onkeydown="if (event.keyCode == 13) { Search(); }" placeholder="抽纸" />
                    </div>
                </td>
                <td><input id="start" class="btn btn-success" type="button" value="搜 索" onclick="Search()" /></td>
            </tr>
        </table>
        <div class="input-group" style="margin-top:20px;">
            <input id="checkbox2" class="styled" type="checkbox" value="全部">全 部
            &nbsp; &nbsp;&nbsp; &nbsp;
            <input id="checkbox3" class="styled" type="checkbox" checked="checked" value="京东">京 东
            &nbsp; &nbsp;&nbsp; &nbsp;
            <input id="checkbox4" class="styled" type="checkbox" value="JUST匠">JUST匠
            &nbsp; &nbsp;&nbsp; &nbsp;
            <input id="checkbox4" class="styled" type="checkbox" value="网易严选">网易严选
        </div>
        <div class="input-group" style="margin-top:20px;">
            <span class="input-group-addon">收货地址：</span>
            <div class="btn-group">
                <input type="button" id="ddladdress" name="ddladdress" class="btn btn-default" value="广东" />
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu">
                    <li><a href="javascript:ChangeAddress('19_1607_4773_0','广东')">广东</a></li>
                    <li><a href="javascript:ChangeAddress('20_1715_43114_51446','广西')">广西</a></li>
                </ul>
            </div>
        </div>
        <div id="goodsrow" class="row" style="margin-top:30px;">

        </div>
    </div>
    <script type="text/javascript">

        function ChangeAddress(p, t) {
            $("#ddladdress").val(t);
            $("#address").val(p);
        }
        function CheckStock(skuid) {
            var area = $("#address").val();
            $.post("/home/CanBuy", { "area": area, "skuid": skuid }, function (data) {
                $("#msg_" + skuid).html(data);
            });
        }

        $(function () {
            Search();
        });

        function Search() {
            var types = "";
            $.each($('input:checkbox:checked'), function () {
                types += this.value + ',';
            });
            if (types == "") {
                alert("选择一个类型呗！");
            }

            $.ajax({
                url: "/Home/GoodsList",
                type: "Post",
                data: { "keyword": $("#keyword").val(), "type": types },
                success: function (data) {
                    $("#goodsrow").html(data);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("加载失败：" + errorThrown);
                }
            });
        }
    </script>
</body>
</html>
